package com.demo.services.impl;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.HibernateException;
import org.springframework.aop.ThrowsAdvice;

import com.demo.dao.UserDao;
import com.demo.entity.Userinfo;
import com.demo.otherbeans.PagesBean;
import com.demo.services.UserServices;

public class UserServicesImpl implements UserServices{
	
	private UserDao userDao;
	
	public List<Userinfo> findUser(String hql) {
		return userDao.findUser(hql);
	}

	public PagesBean findUserPageByHql(String hql, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return userDao.findUserPageByHql(hql, currentPage, pageSize);
	}

	public PagesBean findUserPageBySql(String hql, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return userDao.findUserPageBySql(hql, currentPage, pageSize);
	}

	public void saveUser(Userinfo userinfo){   
		userDao.saveUser(userinfo); 
	}

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public String getDatabaseType() throws HibernateException, SQLException {
		return userDao.getDatabaseType();
	}
	
}
